On the stability boundaries of linear periodic Hamiltonian or reversible differential equations