Rotational dynamics of optically trapped nanofibers