Detection of leaks in membranes