The rare hazel dormouse is under threat as shrinking habitats make it difficult for the creatures to cross between gaps in tree canopies, a new study has found.