Prevents opening the same file twice, if does not share a buffer.