How do I lock a file on opening it? the bultin open() only allows me to set the read/write mode, not any deny modes.