I experienced this practice on a recent MIA-LHR flight. The FA noticed several of us in line, and asked if anyone had come out of the one lav recently. When we said noone had, she walked over, knocked on the door, and getting no response, made some random comment about the pilots using it and "forgetting to unlock it for pax". She did promptly open it for us.