More than a thousand inmates will be released early to free up spaces in prisons in England and Wales, the justice secretary has announced, as the government grapples with an overcrowding crisis.