Use flock if O_SHLOCK and O_EXLOCK are missing