strutil: Fixed safe and secure memory freeing functions