The same stories apply to the UZI (aka MP2 in Germany), too. An old Bundeswehr joke was:
How do you clear a room with a MP2?
Load it, unlock it and throw it into the room. Once it stopped fireing you can move in.
The MP38 had this problem, too, but I think it was fixed with the MP40. You can see a cut-out (where it says "S") on the "safety mechanism", which the MP38 lacked. I´m not sure how safe the MP40 was, but it was atleast safer than the MP38.