Basic Windows thread, atomic and directory implementations