Self-dual skew codes and factorization of skew polynomials