Fixed quota wrapper to return the value from flock()

Please review @schiesbn @icewind1991 

CC @craigpg 

Will need a backport as well.