added flock with duplicates of file paths in /var/lock
added tests for flock
fixed random filename generation
resolve full path of files for file lock path
made locked file handles into an array to handle instances where we lock files multiple times and dont end up unlocking all of them