Update routeros.class.php

Change fread and fwrite use to be more safe.